<style>
    .intranet_hand {
        cursor: pointer;
    }
    #intranetTpl .intranet_row {
        float: left;
        width: 100%;
        clear: both
    }
    #intranetTpl .intranet_body {
        float: left;
        width: 100% !important;
    }
    #intranetTpl .intranet_header {
        background: #007549;
        color: #fff;
        height: 20px;
        line-height: 20px;
        text-align: center;
        font-size: 14px
    }
</style>
<div id="intranetTpl">
    <div class="intranet_row">
        <!-- header -->
        <div class="intranet_header">
            myJabil
            <i class="main_common_f_13_13 intranet_panel_resize right wp_mt_3 wp_mr_5 intranet_hand" title="Expand"></i>
        </div>
    </div>
    <!-- body -->
    <div class="intranet_row" id="intranet_entity">
        <div class="intranet_body" id="intranet_body" style="background-color: #ffffff">
        </div>
    </div>
</div>
<script>
    var intranet = (function () {
        var pageTpl = $('#intranetTpl'),
            bodyTpl = $('#intranet_body'),
            _height = Workport.utils.getViewPort().height-83,
            _min = true,   // if is min window
            jabLoader,
            _loginHeight = -(Workport.utils.getViewPort().height / 2 + 300);
        var iframeMin = '<iframe id="minJab" src="'+intranetUrl+'" style="border: 0" width="100%" height="'+ _height +'" frameborder="0" scrolling="yes"></iframe>';
        return{
            init: function () {
                bodyTpl.height(_height);
                // pageTpl.appendTo('#intranet');
                $('#intranet').html(pageTpl);
                jabLoader = new Workport.Loader($('#intranet'),{ text:'Loading', position:'center',imgColor:'black', textCSS:{'color':'black'} });
                jabLoader.show();
                $(".intranet_body").html(iframeMin);
//                $("#intranet_body").css("overflow-y", "none");
                document.getElementById('minJab').onload = function() {
                    jabLoader.hide();
                };
                //scroll in homepage
                HomePage_Scrollable.registerZoomCallback(WPMoudleManager.getModule('intranet').index, intranet.switchMax, intranet.switchMin);
                $('.intranet_panel_resize').on({
                    click: function (e) {
                        if (_min) {
                            intranet.switchMax();
                        } else {
                            HomePage_Scrollable.zoom(WPMoudleManager.getModule('intranet').index);
                            _min = true;
                        }
                    }
                });
            },
            switchMin: function () {
                $(".intranet_panel_resize").toggleClass("main_common_f_13_13 main_common_m_13_13");
                $(".intranet_panel_resize").attr("title",'Expand');
                _min = true;
                $('#login_button').css("margin-top", _loginHeight).css("margin-left", "102px").on({
                    click: function (e) {
                        intranet.switchMax();
                    }
                });
            },
            switchMax: function () {
                if (_min) {
                    _min = false;
//                    jabLoader.show();
                    $(".intranet_panel_resize").toggleClass("main_common_f_13_13 main_common_m_13_13");
                    $(".intranet_panel_resize").attr("title",'Collapse');
                    HomePage_Scrollable.zoom(WPMoudleManager.getModule('intranet').index);
                    /*var iframe = '<iframe id="intranet_iframe" width="100%" height="100%" frameborder="0" src="' + intranetUrl + '"></iframe>';
                    $(".intranet_body").html(iframe);
                    $("#intranet_body").css("overflow-y", "none");
                    document.getElementById('intranet_iframe').onload = function() {
                        jabLoader.hide();
                    };*/
                }
            }
        }
    })();
    //    if(intranetShow){
    intranet.init();
    //    }
</script>